﻿@model LeadMaster.ViewModels.ViewModelLeads

<table>
<tr>
<th class="rowheader">@Html.Label("Salutation")</th>

@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @Html.HiddenFor(m => Model.ClientContacts[i].ContactID)
    @Html.HiddenFor(m => Model.ClientContacts[i].CompanyID)
    @:<td>
    @Html.DropDownListFor(m => Model.ClientContacts[i].SalutationID, new SelectList(Model.Salutations, "SalutationID", "Salutation"), new { @class="currentSalutation", onload="salutationloaded();" })
    @:</td>
	<script type="text/javascript">
		$().ready(function () {
			$("#ClientContacts_@(i)__SalutationID").val("@(Model.ClientContacts[i].SalutationID)");
		});
	</script>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.Forename)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>
    @Html.TextBoxFor(model => model.ClientContacts[i].Forename)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.Surname)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>
    @Html.TextBoxFor(model => model.ClientContacts[i].Surname)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.Title)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].Title)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">
@Html.LabelFor(model => model.Contact.Email)
</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>   
    @Html.TextBoxFor(model => model.ClientContacts[i].Email)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.skype)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].skype)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.Telephone)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>
    @Html.TextBoxFor(model => model.ClientContacts[i].Telephone)
    @Html.RadioButtonFor(model => model.ClientContacts[i].DefaultTelephoneField, "Telephone")
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.Tel2)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].Tel2)
    @Html.RadioButtonFor(model => model.ClientContacts[i].DefaultTelephoneField, "Tel2")
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.Label("Mobile")</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].Mobile1)
    @Html.RadioButtonFor(model => model.ClientContacts[i].DefaultTelephoneField, "Mobile1")
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.Mobile2)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].Mobile2)
    @Html.RadioButtonFor(model => model.ClientContacts[i].DefaultTelephoneField, "Mobile2")
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.linkedin)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].linkedin)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.googleid)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextBoxFor(model => model.ClientContacts[i].googleid)
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.LabelFor(model => model.Contact.notes)</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td>    
    @Html.TextAreaFor(model => model.ClientContacts[i].notes, new { @class = "smallnotes" })
    @:</td>
}
</tr>
<tr>
<th class="rowheader">@Html.Label("Default")</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td style="text-align: center">    
    <input 
    @if (Model.ClientContacts[i].ContactID == Model.Lead.ContactID)
	{
     @:checked="checked" 
    }
    id="ContactID" name="ContactID" type="radio" value="@(Model.ClientContacts[i].ContactID)">
    @:</td>
}
</tr>

<tr>
<th class="rowheader">@Html.Label("LLN")</th>
@for (int i = 0; i < Model.ClientContacts.Count; i++)
{
    @:<td style="text-align: center">    
    @Html.CheckBoxFor(m => m.ClientContacts[i].LLN)
    @:</td>
}
</tr>

</table>
